using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;

public class Room : MonoBehaviour
{
    public GameObject doorLeft, doorRight, doorUp, doorDown;
    public bool roomLeft, roomRight, roomUp, roomDown;
    public int stepToStart;
    
    public int doorNumber;//门数量
    void Start()
    {
        doorLeft.SetActive(roomLeft);
        doorRight.SetActive(roomRight);
        doorUp.SetActive(roomUp);
        doorDown.SetActive(roomDown);
    }

    public void UpdateRoom(float xoffset, float yoffset)
    {
        stepToStart=(int)(Mathf.Abs(transform.position.x/xoffset)+Mathf.Abs(transform.position.y/yoffset));//到达该点所需要的步数
        //记录门的数量
        if (roomLeft) doorNumber++;
        if (roomRight) doorNumber++;
        if (roomUp) doorNumber++;
        if (roomDown) doorNumber++;
    }
}
